package com.itheima.collections;/*
 *@author wenqh
 *@date 2024/4/19 9:57
 *@Description
 */


import org.springframework.aop.scope.ScopedProxyUtils;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class List_Test {


    public static void main(String[] args) {
        List<Integer> arrayList = new ArrayList<>();
        LinkedList<String> linkedList = new LinkedList<>();
        //添加
        arrayList.add(1);
        arrayList.add(1,5);
        //修改
        arrayList.set(1,6);
        //删除
        arrayList.remove(0);
        arrayList.remove(new Integer(5));
        //遍历
        for (Integer num : arrayList){
            System.out.println(num);
        }
        arrayList.iterator();
        System.out.println("------------------------------------");
        linkedList.addLast("2");
        linkedList.addFirst("1");
        linkedList.peekFirst();
        linkedList.peekLast();

    }
}
